{extend name="index_layout"/}
{block name="main"}
<form class="layui-form" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">水票名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="水票名称"
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">所属商品分类</label>
        <div class="layui-input-block">
            <select name="goods_id" lay-verify="required" lay-search="">
                <option value="">所属商品</option>
                {if !empty($goodsCategoty)}
                {foreach name="goodsCategoty" item="vo"}
                <option value="{$vo.id}" disabled="disabled">=======>{$vo.name}</option>
                {foreach name="vo.goods" item="vo2"}
                <option value="{$vo.id},{$vo2.id}" >{$vo2.name}</option>
                {/foreach}
                {/foreach}
                {/if}
            </select>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="sort" lay-verify="required|Number" autocomplete="off" placeholder="排序"
                   class="layui-input">
        </div>
    </div>
    <!--    <div class="layui-form-item">-->
    <!--        <label class="layui-form-label">所属商品</label>-->
    <!--        <div class="layui-input-block">-->
    <!--            <input type="password" name="password_confirm" lay-verify="required" autocomplete="off" placeholder="确认密码" class="layui-input">-->
    <!--        </div>-->
    <!--    </div>-->

    <div class="layui-form-item">
        <label class="layui-form-label">背景图：建议{:config('site.tickets_long')}*{:config('site.tickets_width')}</label>
        <div class="layui-input-block">
            <div class="w300">
                <input type="text" lay-verify="required" name="img" id="c-pic" value="" class="layui-input">
            </div>
            <button type="button" class="layui-btn faupload" id="faupload-pic" data-multiple="false"
                    data-input-id="c-pic"
                    data-preview-id="p-pic" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic" id="fachoose-c-pic"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic"></ul>
        </div>
    </div>


    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use('yznForm', function () {
        var yznForm = layui.yznForm;
        yznForm.bindevent($("form.layui-form"));
    });
</script>
{/block}